/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.common.web.control;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class NetApnChangeReceiver extends BroadcastReceiver {
    public a a;
    public Activity b;
    private ConnectivityManager c = null;

    public NetApnChangeReceiver(Activity paramActivity, a parama) {
        this.a = parama;
        this.b = paramActivity;
        this.c = ((ConnectivityManager) this.b.getSystemService("connectivity"));
    }

    public void onReceive(Context paramContext, Intent paramIntent) {
        if (!("android.net.conn.CONNECTIVITY_CHANGE".equals(paramIntent.getAction())))
            return;
        if (this.c != null) {
            NetworkInfo localNetworkInfo = this.c.getActiveNetworkInfo();
            if ((localNetworkInfo == null) || (!(localNetworkInfo.isAvailable()))) {
                if (this.a != null)
                    this.a.b();
            }
            else {
                int i = localNetworkInfo.getType();
                if ((((i == 1) || (i == 0))) && (this.a != null))
                    this.a.b();
            }
        }
        else {
            this.c = ((ConnectivityManager) this.b.getSystemService("connectivity"));
        }
    }
}